package com.demo6.demo.core.controller;

import com.demo6.demo.core.entity.TableDataInfo;
import com.github.pagehelper.PageInfo;

import java.util.List;

/**
 * User: wangy
 * Date: 2020/6/11
 * Description: No Description
 */
public class BaseController {
    protected TableDataInfo getDataTable(List<?> list)
    {
        TableDataInfo rspData = new TableDataInfo();
        rspData.setCode(0);
        rspData.setRows(list);
        rspData.setTotal(new PageInfo(list).getTotal());
        return rspData;
    }
}
